<!DOCTYPE html>
<html>
<head>
    <title>百越小程序商城订单打印</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width"/>
    <meta name="keyworks" content="test" />
    <meta name="description" content="test2" />

    <!-- Jquery -->
    <script src="{{url('js/jquery.min.js')}}"></script>

    <!-- Noty 提示框的js集成 -->
    <script src="{{ url('vendors/noty-2.2.9/packaged/jquery.noty.packaged.js') }}"></script>
    <script src="{{ url('vendors/noty-2.2.9/themes/bootstrap.js') }}"></script>
    <script src="{{ url('vendors/noty-2.2.9/options.js') }}"></script>

    <!-- Plupload上传类 -->
    <script src="{{ url('vendors/plupload-2.1.2/plupload.full.min.js') }}"></script>
    <script src="{{ url('vendors/plupload-2.1.2/i18n/zh_CN.js') }}"></script>

    <link href="{{url('css/admin/index.css')}}" rel="stylesheet" />
    <script src="{{url('js/index.js')}}"></script>
    <style>
        .orders{margin-top: 20px;padding: 20px;}
        .order-info-level{display: flex;flex-direction: row;margin-bottom: 10px}
        .order-info-level .user-info{width: 25%;font-size: 14px;}
        .info-title{font-weight: bold}
        thead{font-weight: bold}
        .order-table{}
    </style>
</head>
<body>
<div>
    <div style="text-align: center;margin-top: 10px"><h2>百越网购小程序订单信息{{date("Y-m-d H:i:s")}}</h2></div>

    @if(count($orders) > 0)
        @foreach($orders as $order)
    <div class="orders">
        <div class="order-info">
            <div class="order-info-level">
                <div class="user-info"><span class="info-title">购货人：</span>@if($order->address){{$order->address->consignee}}@endif</div>
                <div class="user-info"><span class="info-title">下单时间：</span>{{$order->created_at}}</div>
                <div class="user-info"><span class="info-title">支付方式：</span>@if($order->pay_type == "balance")账户余额 @elseif($order->pay_type == "weixin")微信 @else - @endif</div>
                <div class="user-info"><span class="info-title">订单编号：</span>{{$order->order_num}}</div>
            </div>
            <div class="order-info-level">
                <div class="user-info"><span class="info-title">付款时间：</span>@if(is_null($order->pay_time) || $order->pay_time == "")未支付 @else{{ $order->pay_time}} @endif</div>
                <div class="user-info"><span class="info-title">发货时间：</span>@if(is_null($order->express_time) || $order->express_time == "")未发货 @else{{ $order->express_time}} @endif</div>
                <div class="user-info"><span class="info-title">配送方式：</span>-</div>
                <div class="user-info"><span class="info-title">提货点：</span>-</div>
            </div>
            <div class="order-info-level">
                <div style="min-width: 30px;font-size: 14px;margin-right: 20px"><span class="info-title">收货地址：</span>@if($order->address){{$order->address->province}}{{$order->address->city}}{{$order->address->area}}{{$order->address->address}}@endif</div>
                <div style="min-width: 30px;font-size: 14px;margin-right: 20px"><span class="info-title">收货人：</span>@if($order->address){{$order->address->consignee}}@endif</div>
                <div style="min-width: 30px;font-size: 14px;margin-right: 20px"><span class="info-title">电话：</span>@if($order->address){{$order->address->telephone}}@endif</div>
                <div style="min-width: 30px;font-size: 14px;margin-right: 20px"><span class="info-title">手机：</span>@if($order->address){{$order->address->phone}}@endif</div>
            </div>
        </div>
        <div class="order-table">
            <table border="1" cellspacing="0">
                <thead>
                    <tr>
                        <th style="width: 50%">商品名称</th>
                        <th style="width: 5%">数量</th>
                        <th style="width: 10%">价格</th>
                        <th style="width: 15%">属性</th>
                        <th style="width: 20%">小计</th>
                    </tr>
                </thead>
                <tbody>
                @if(count($order->order_items) > 0)
                    @foreach($order->order_items as $orderItem)
                    <tr>
                        <td>@if($orderItem->goods){{$orderItem->goods->name}}@endif</td>
                        <td style="text-align: center">{{$orderItem->num}}</td>
                        <td style="text-align: center">￥{{$orderItem->s_price}}</td>
                        <td style="text-align: center">{{$orderItem->goods_spu}}</td>
                        <td style="text-align: right">￥{{$orderItem->num * $orderItem->s_price}}元</td>
                    </tr>
                    @endforeach
                    @endif
                </tbody>
            </table>
            <div style="display: flex;flex-direction: row;">
                <div style="width: 80%"></div>
                <div style="width: 20%;text-align: center">=订单总金额：￥{{$order->s_amount}}元</div>
            </div>
            <div style="display: flex;flex-direction: row;">
                <div style="width: 80%"></div>
                <div style="width: 20%;text-align: center">=应付款金额：￥{{$order->s_amount}}元</div>
            </div>
        </div>
        <div>
            <div>番禺石基供销社-百越网小程序 电话：020-84853393</div>
            <div style="display: flex;flex-direction: row;margin-top: 10px">
                <div style="width: 20%;font-weight: bold">经办人：</div>
                <div style="width: 20%;font-weight: bold">复合：</div>
                <div style="width: 20%;font-weight: bold">客户确认：</div>
                <div style="width: 40%;font-weight: bold"></div>
            </div>
        </div>
        <div style="border-bottom: 1px dashed #bab9b9;width: 100%;padding: 20px"></div>
    </div>
        @endforeach
        @endif
</div>
</body>
</html>